package com.hspjava.Homework;

public class Homework04 {
    public static void main(String[] args) {
        count(null);
    }
    public static void count(String str) {
        if (str == null) {
            System.out.println("参数错误");
            return;
        }
        int count_num = 0;
        int count_s = 0;
        int count_l = 0;
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) >= '0' && str.charAt(i) <= '9') {
                count_num++;
            } else if(str.charAt(i) >= 'a' && str.charAt(i) <= 'z') {
                count_s++;
            } else if (str.charAt(i) >= 'A' && str.charAt(i) <= 'Z') {
                count_l++;
            }

        }

        System.out.println("大写字母有" + count_l + " 小写字母有" + count_s + " 数字有" + count_num);

    }
}
